# -*- coding:utf8 -*-
from django.db import models
from django.contrib import admin
from django.core.paginator import Paginator


# Create your models here.
    
class Type(models.Model):
    name = models.CharField(max_length=50)
    def __unicode__(self):
        return self.name
    
class User(models.Model):
    name = models.CharField(max_length=50)
    passwd = models.CharField(max_length=50)
    def __unicode__(self):
        return self.name

class Docs(models.Model):
    title = models.CharField('标题',max_length=50)
    body = models.TextField('正文')
    pub_date = models.DateTimeField('日期')
    user_id = models.ForeignKey(User,verbose_name='用户ID')
    type_id = models.ForeignKey(Type,verbose_name='分类')
    def __unicode__(self):
        return '%s %s' % (self.title,self.body)